package main

import (
	"gitee.com/tietang/terrace-go/v2/code"
	"path/filepath"
	"runtime"
	"upper.io/db.v3/mysql"
)

func main() {
	s := mysql.ConnectionURL{
		Database: "information_schema",
		//Host:     "127.0.0.1:3306",
		User:     "root",
		Password: "111111",
		Options:  map[string]string{},
	}
	_, f, _, _ := runtime.Caller(0)
	dir := filepath.Dir(f)

	gen := code.CodeGenerator{
		TemplateDir: "/Users/tail/go-projects/infra/code/dbx",
		//TemplateDir: "/Users/tail/java/go_third/gitee.com/tietang/terrace-go/v2/code/dbx/",
		SrcRootDir: filepath.Join(dir, "/gen"),
		Tables: []string{
			"account",
		},
		DbName:   "po",
		Settings: s,
	}
	gen.Gen()
}
